/*
 * Created on Jan 25, 2004
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.user;

import java.io.Serializable;
import java.util.Collection;

import org.vectrics.common.db.ChangeReportable;
import org.vectrics.common.db.RecordObject;
import org.vectrics.location.Address;

/**
 * @author mmoore
 */
public class ContactInfo implements RecordObject, Serializable, ChangeReportable {

	public static final long serialVersionUID = 13512666322345L;
	
	private String email;
	private Boolean htmlEmail = new Boolean(true); 
	private String email2;
	private Boolean htmlEmail2 = new Boolean(true); 
	private PhoneNumber workPhone;
	private PhoneNumber homePhone;
	private PhoneNumber alternatePhone;
	private PhoneNumber cellPhone;
	private PhoneNumber fax;
	private Address homeAddress = null;
	private Address workAddress = null;
	private Person person = null;
	private Long personId = null;
	private Long id = null;
	
	
    /**
     * @return Returns the id.
     */
    public Long getId() {
        return id;
    }
    
    /**
     * @param id The id to set.
     */
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getPersonId() {
        return personId;
    }
     
    public void setPersonId(Long personId) {
        this.personId = personId;
    }
    
	public String toString() {
		if (getId() == null)
			return(null);
		return getId().toString();
	}
	
	/**
	 * 
	 */
	public ContactInfo() {
		super();
	}
	
    /**
     * @return Returns the person.
     */
    public Person getPerson() {
        return person;
    }
    
    /**
     * @param person The person to set.
     */
    public void setPerson(Person person) {
        this.person = person;
    }

	public Collection getContactAttributes() {
		return null;
	}

	public UserAttribute findContactAttribute(String arg0) {
		return null;
	}

	public void removeContactAttribute(String arg0) {
	}

	public Address getHomeAddress() {
		return(homeAddress);
	}
	
	public Address createHomeAddressIfNotExist() {
		if (homeAddress == null)
			homeAddress = new Address();
		return(homeAddress);
	}

	public void setHomeAddress(Address address) {
		this.homeAddress = address;
	}

	public Address getWorkAddress() {
		return(workAddress);
	}

	public Address createWorkAddressIfNotExist() {
		if (workAddress == null)
			workAddress = new Address();
		return(workAddress);
	}

	public void setWorkAddress(Address address) {
		this.workAddress = address;
	}

	public String getEmail() {
		return(email);
	}

	public void setEmail(String arg0) {
		this.email = arg0;
	}

	public String getEmail2() {
		return(email2);
	}

	public void setEmail2(String arg0) {
		this.email2 = arg0;
	}
	
	/**
	 * @return Returns the alternatePhone.
	 */
	public PhoneNumber getAlternatePhone() {
		return alternatePhone;
	}

	/**
	 * @param alternatePhone The alternatePhone to set.
	 */
	public void setAlternatePhone(PhoneNumber alternatePhone) {
		this.alternatePhone = alternatePhone;
	}

	/**
	 * @return Returns the cellPhone.
	 */
	public PhoneNumber getCellPhone() {
		return cellPhone;
	}

	/**
	 * @param cellPhone The cellPhone to set.
	 */
	public void setCellPhone(PhoneNumber cellPhone) {
		this.cellPhone = cellPhone;
	}

	/**
	 * @return Returns the homePhone.
	 */
	public PhoneNumber getHomePhone() {
		return homePhone;
	}

	/**
	 * @param homePhone The homePhone to set.
	 */
	public void setHomePhone(PhoneNumber homePhone) {
		this.homePhone = homePhone;
	}

	/**
	 * @return Returns the workPhone.
	 */
	public PhoneNumber getWorkPhone() {
		return workPhone;
	}

	/**
	 * @param workPhone The workPhone to set.
	 */
	public void setWorkPhone(PhoneNumber workPhone) {
		this.workPhone = workPhone;
	}

	/**
	 * @return Returns the htmlEmail.
	 */
	public Boolean getHtmlEmail() {
		return htmlEmail;
	}
	/**
	 * @param htmlEmail The htmlEmail to set.
	 */
	public void setHtmlEmail(Boolean htmlEmail) {
		this.htmlEmail = htmlEmail;
	}
	/**
	 * @return Returns the htmlEmail2.
	 */
	public Boolean getHtmlEmail2() {
		return htmlEmail2;
	}
	/**
	 * @param htmlEmail2 The htmlEmail2 to set.
	 */
	public void setHtmlEmail2(Boolean htmlEmail2) {
		this.htmlEmail2 = htmlEmail2;
	}

	/**
	 * @return Returns the fax.
	 */
	public PhoneNumber getFax() {
		return fax;
	}

	/**
	 * @param fax The fax to set.
	 */
	public void setFax(PhoneNumber fax) {
		this.fax = fax;
	}
	
}
